<!DOCTYPE html>  
<html>  
    <head>  
        <meta charset="utf-8" />  
        <title></title>  
        <script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js" ></script>  
        <script type="text/JavaScript">  
            function denglu(){  
                alert("进入单击事件");      
                var username=document.getElementById("username").value;  
                alert("username:"+username);  
                var pass=document.getElementById("password").value;  
                alert("password:"+pass);  
                $.ajax({  
                    contentType:'application/json',  
                    xhrFields: {  
                        withCredentials: true  
                    },  
                    type:"post",  
                    data: JSON.stringify({  
                        adminUser:username,  
                        passWord:pass  
                    }),  
                    url:"http://localhost:8088/genealogy/api/login",  
                    success: function(data){  
                        alert(data);  
                        alert("成功");  
                        //window.location.href = 'main.html';  
                    }  
                });  
            }  
              
            function huoqu(){  
                alert("进入单击事件");      
                $.ajax({  
                    xhrFields: {  
                        withCredentials: true  
                    },  
                    type:"get",  
                    date:{},  
                    url:"http://localhost:8088/genealogy/api/logout",  
                    success: function(data){  
                        alert(data);  
                        alert("成功");  
                    }  
                });  
            }  
        </script>  
    </head>  
    <body>  
            用户名：<input type="text" id="username" name="username"/><br />  
            密码：<input type="text" id="password" name="password"/><br />  
            <input type="button" id="tj" value="登录" onclick="denglu();"/>  
            <input type="button" onclick="huoqu();" value="查询当前seesion中的管理员"/>  
    </body>  
</html>  